import { gql } from "@apollo/client";
import { doseFormListGql, doseFormDataDictionaryGql } from "./does-form";

const routeListGql = gql`
  query ($pageBean: PageBeanInput) {
    queryMaxRouteList(filterStr: null, pageBean: $pageBean) {
      pageNow
      count
      termIdList
      maxRouteList {
        routeId
        mapToTermId
        termId
        routeEng
        routeChi
        routeOtherName
        routeMultiplier
        rankNumber
        enableInRegimen
        ehrValue
        ehrDescription
        ehrStatus
        defaultMapping
        stageId
        qualifierStatus
      }
    }
  }
`;

const routeDataDictionaryGql = gql`
  {
    queryStageList {
      stageId
      stageDisplay
      stageDescription
    }
    queryEhrStatusList {
      ehrStatus
      ehrStatusDescription
    }
    queryEhrDescriptionList(subsetId: 104) {
      termIdEhrDesc
      ehrValue
      termIdEhrStatus
    }
    queryDefaultMapList {
      defaultMapCode
      defaultMapDescription
    }
  }
`;

const saveRouteListGql = gql`
  mutation ($userId: String!, $maxRouteReqList: [MaxRouteReq]) {
    saveMaxRoute(userId: $userId, maxRouteReqList: $maxRouteReqList) {
      responseCode
      responseMessage
      pageNow
      pageCount
      count
    }
  }
`;

export {
  routeListGql,
  routeDataDictionaryGql,
  saveRouteListGql,
  doseFormListGql,
  doseFormDataDictionaryGql,
};
